Find and Replace Pane

The Script Editor's Find and Replace Pane, which is hidden by default, allows you to find and replace words or phrases in your code.

To find a word or phrase in your code

  1. Open the ClosedFind and Replace Pane by using the keyboard shortcut CTRL+F or by clicking View from the main menu of the Script Editor and selecting Find.
  2. Type the text you want to find under Find what in the pane.
  3. Select where you want to look for the text by clicking on the drop-down menu under Look in. Select to search the Current Document (script file), All Open Documents (script files), or the Current Project (all script files in the project).
  4. Optional: Under Find Options, choose to Match Case, Match whole word, or Search up (search from the bottom of the document to the top). You can also select the Use option and choose Regular expressions or Wildcards from the drop down menu. If you select to use regular expressions, the pattern matching button next to the Find what text box will display a list of regular expressions you can use in your search term. If you select to use wildcards, the same button will display a list of wildcards you can use in your search term.
  5. Click Find Next to go to the next instance of your search term in the code or Find All to find all instances of your search term in the code. The search term will be highlighted in the code.
  6. Optional: Click Bookmark All to bookmark every line that the search term appears in.

To replace a word or phrase in your code

  1. Open the Find and Replace Pane by using the keyboard shortcut CTRL+F or by clicking View from the main menu of the Script Editor and selecting Find.
  2. Click ClosedReplace at the top of the pane.
  3. Type the text you want to find under Find what in the pane.
  4. Under Replace with, type the text you want to replace the text under Find What.
  5. Select where you want to look for the text by clicking on the drop-down menu under Look in. Select to search the Current Document (script file), All Open Documents (script files), or the Current Project (all script files in the project).
  6. Optional: Under Find Options, choose to Match Case, Match whole word, or Search up (search from the bottom of the document to the top). You can also select the Use option and choose Regular expressions or Wildcards from the drop down menu. If you select to use regular expressions, the pattern matching button next to the Find what text box will display a list of regular expressions you can use in your search term. If you select to use wildcards, the same button will display a list of wildcards you can use in your search term.
  7. Optional: Under Replace Options, you can select to keep open the files in which you replaced text if you select Replace All below.
  8. Click Find Next to go to the next instance of your search term in the code. Click Replace to replace that single instance of the search term. Click Replace All to automatically replace all the search terms in your code with the text you typed under Replace with.
  9. Optional: Click Bookmark All to bookmark every line that the search term appears in.